#include <bits/stdc++.h>
using namespace std;
const int N = 5050;
int n, m;

struct Range {
	int num, scor;
	bool operator< (const Range &W)const {
		if (scor == W.scor) {
			return num < W.num;
		} else {
			return scor > W.scor;
		}
	}
} range[N];

int main() {
	int flag = 0;
	cin >> n >> m;
	m = (int)m * 1.5;
	for (int i = 0; i < n; ++i) {
		cin >> range[i].num >> range[i].scor;
	}
	sort(range, range + n);

	for (int i = 0; i < n; ++i) {
		if (range[m - 1].scor <= range[i].scor)
			flag++;
		else
			break;
	}
	cout << range[m - 1].scor << ' ' << flag << endl;
	for (int i = 0; i < flag; ++i) {
		cout << range[i].num << ' ' << range[i].scor << endl;
	}
	return 0;
}